﻿using CodeCity.UserManagement.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeCity.UserMangament.Repository
{
    public class HosiptalRepository : RepositoryBase<Hosiptal>
    {
        public HosiptalRepository(GameDbContext gameDbContext) : base(gameDbContext)
        {
        }

        public Task<bool> ExistAsync(long unitId)
        {
            return Query.AnyAsync(x => x.UnitId == unitId);
        }

        public Task<Hosiptal> GetByUnitIdAsync(long unitId)
        {
            return Query.FirstOrDefaultAsync(x => x.UnitId == unitId);
        }
    }
}
